//
//  AboutJiukuViewController.m
//  JiuKuGospel
//
//  Created by jiukuyinyue on 15-9-1.
//  Copyright (c) 2015年 JiuKuForApp. All rights reserved.
//

#import "AboutJiukuViewController.h"

@interface AboutJiukuViewController ()

@end

@implementation AboutJiukuViewController
- (BOOL)canBecomeFirstResponder{
    return YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"关于";
    [self setupUI];
    [self setOtherUI];
}
- (void)setupUI
{
    UIImageView * titleImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth/ 5.0, ScreenWidth / 5.0)];
    titleImageView.image = [UIImage imageNamed:@"我的_设置_关于"];
    titleImageView.frame = CGRectMake(ScreenWidth/5*2, 30+NAVIGATION_BAR_HEIGHT, titleImageView.frame.size.width, titleImageView.frame.size.height);
    [self.view addSubview:titleImageView];
    
    UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(titleImageView.frame)+20, ScreenWidth, 30)];
    titleLabel.text = @"新郑扶贫";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.textColor = titleColorLSZ;
    [self.view addSubview:titleLabel];
    
    UILabel * bundleVSLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(titleLabel.frame)+10,ScreenWidth, 30)];
    bundleVSLabel.textAlignment = NSTextAlignmentCenter;
    bundleVSLabel.textColor = titleColorLSZ;
    NSDictionary * infoDic = [[NSBundle mainBundle] infoDictionary];
    CFShow((__bridge CFTypeRef)(infoDic));
    NSString * appVersion = [infoDic objectForKey:@"CFBundleShortVersionString"];
    bundleVSLabel.text = [NSString stringWithFormat:@"当前版本号: V %@", appVersion];
    [self.view addSubview:bundleVSLabel];
    titleLabel.font = FONT_(14);
    bundleVSLabel.font = FONT_(14);
}
-(void)setOtherUI
{
    NSMutableAttributedString * webSiteStr = [[NSMutableAttributedString alloc]initWithString:@"官方网站:http://www.cnshennongshi.com/"];
    UILabel * labelWebSite = [[UILabel alloc]init];
    labelWebSite.frame = CGRectMake(40, ScreenHeight-30-20, ScreenWidth-40, 20);
    labelWebSite.textColor = titleColorLSZ;
    labelWebSite.font = FONT_(14);
    [webSiteStr addAttribute:NSForegroundColorAttributeName value:RGBColor(17, 182, 255) range:NSMakeRange(5, webSiteStr.length-5)];
    labelWebSite.attributedText = webSiteStr;
    [self.view addSubview:labelWebSite];
    
    NSMutableAttributedString * businessCooperationStr = [[NSMutableAttributedString alloc]initWithString:@"商务合作:15036413850"];
    UILabel * labelBusinessCooperation = [[UILabel alloc]init];
    labelBusinessCooperation.frame = CGRectMake(40, CGRectGetMinY(labelWebSite.frame) -20, ScreenWidth-40, 20);
    labelBusinessCooperation.textColor = titleColorLSZ;
    labelBusinessCooperation.font = FONT_(14);
    [businessCooperationStr addAttribute:NSForegroundColorAttributeName value:RGBColor(17, 182, 255) range:NSMakeRange(5, businessCooperationStr.length-5)];
    labelBusinessCooperation.attributedText = businessCooperationStr;
    [self.view addSubview:labelBusinessCooperation];
    
    NSMutableAttributedString * workingPhoneStr = [[NSMutableAttributedString alloc]initWithString:@"客服电话:0371-86031107"];
    UILabel * labelWorkingPhone = [[UILabel alloc]init];
    labelWorkingPhone.frame = CGRectMake(40, CGRectGetMinY(labelBusinessCooperation.frame) -20, ScreenWidth-40, 20);
    labelWorkingPhone.textColor = titleColorLSZ;
    labelWorkingPhone.font = FONT_(14);
    [workingPhoneStr addAttribute:NSForegroundColorAttributeName value:RGBColor(17, 182, 255) range:NSMakeRange(5, workingPhoneStr.length-5)];
    labelWorkingPhone.attributedText = workingPhoneStr;
    [self.view addSubview:labelWorkingPhone];
}
- (void)leftBtnAction
{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
